reproduce reported issue. see #12
fixed issue #12
added several test cases. refs #12
added comment to explain why we can catch Exception. refs #12
Merge pull request #13 from eller86/fix-issue-12

Fix issue 12