Protect against edge cases when logging
Merge branch 'master' into issues-import

* master:
  Protect against edge cases when logging