Fix EOF problem