Added some tests for exception handling