Fixing exit codes on errors. Thanks @rob-b.