added tests to increase code coverage

found and fixed two bugs along the way (invalid exception syntax o0)
resolves #32