fixed code review bugs noted by breunigs