Output error messages if script fails