fixes from second round of code reviews