address bugs/improvements from PR comments