Added exception logging.

Newline before isset() still missing.