fixed typo; added tests for exceptions