Fix EOF problems