Fix offset handling