fixed some JS rounding issues