Support for logging of exceptions
Fixes as noted by Code Analysis