Fixed offset routine and tests.