Added error logging for unexpected exceptions.
- Thanks to Tod Olson!