Fix EOF issues