Replaced Math.ceil with Math.round for greater accuracy

Fixes #7