improved tests for exceptions