[core] Fix the remaining exception exitcodes

Closes GH #1133.