Fixing some oversights in the last error handling refactoring.