Adds more informative error messages and logging.

Adds a missing error log before terminating in certain conditions and
adds Exception details to another error log where it was missing.