Fix floating point exceptions