Change the cast from an int to a float so values don't get truncated. Fixes #2