Fixed EOF issues