Fix wrong offset check (#1)