Exit with code 2 for syntax errors and 1 for other errors