Fixed typo and added tests