Fix a typo and add a couple of tests.