minor fixes from refactor and tests