Fixed wrong file offset check