Fixes a fixed-point precision issue in remove_doubling()

This could lead to an integer overflow. Also, refactored the code a bit
1 file changed