Improved error handling to prevent service crashing. Fixes #38 and #29.

Errors are now logged and service continues to run instead of stopping application.