Catch uncaught exception and clean up dict merging.
Merge pull request #11 from jk0/master

Catch uncaught exceptions and clean up dict merging.