Fix offset handling #602