Remove bug in end of file management (again).