Fix a typo and add a unit test