Fix output file name
Better error message