Fixed crash at end of file.