Typo rename.
Minor refactor and test improvement.