Fixed conversion from float to integer for negative numbers.