improved handling of offsets