Add tests for exceptions