Correct offset calculations in a couple places