Ensure exit codes propagate properly during upgrades
Merge pull request #47 from RJ/fix-exit-codes

Fix exit codes