fixes from first round of code review