Fix rounding and scaling issues [#12]