fix spelling errors and add tests