Added fixed precision to avoid JS rounding issues

Closes #4