Show the right message if no output file has been specified

Also remove some unnecessary casts by using the right data type.