Bug 1028261 - Fix to exit with a non-zero code on errors