Fix tests for refactored exception handling