Fixes EOF issues