Catch uncaught exception and clean up dict merging.