Exit with an exit code of 1 instead of 0 when an error occurs.
Fixed the code that was supposed to exit with a non-zero exit code if one or more errors were emitted.