Remove extra crap at the end of the file