minor misc fixes and tidies encountered using this in the field