Offset bug with delta < 1

One-liner fix to a problem using integer instead of double version of abs(). Also, add a test case for the problem.