Minor
Move offset overflow fixing logic where it belongs