Fixed crash on incomplete & corrupt files