Fixed the rounding, added a test.