Fix reason being nil when logging.

Also fix a typo.

Fixes #1