Fix error in code and typo.

Changed some typos in the code/comments.