Fix for rounding bug

As described in Issue #2 there is currently a rounding bug which this pull request fixes.