Fix unpredictable rounding in some browsers