Added a failing test case for issue #1.
Don't crash when malformed JSON is encountered.

Fixes #1.