Mostly adding documentation, plus some other things noticed along the
way