fix regression introduced in issue #14

misleading log statement, incorrect exception type, and logically flawed.