Catch exceptions during processing (Fix for #1553)