Fixes a type conversion error