minor code fixes based on code review feedback