Fixed empty file crashing