Fixed rounding and negative handling.  Tested OK.