Issue650

Peco's fixes, plus comments.

Replaces @pecko PR: https://github.com/debrief/debrief/pull/651