Fix #349 -- also did a minor private method refactor.