[BUGFIX] Use a typecast to ensure correct value