Typos in code and tests

Fixes several typos in comments and docstrings.