Truncate file if something goes wrong