Improved error / exception handling. Added error / exception write functionality to syslog.