Fix tests for exceptions