partial fixes from code review