Fixed typos and added test.