Fix typo and add tests