fixes from PR 23 code review