Fix a few typos

I have fixed a few typos in the code.

I am still having a look at what you've done, it's really smart! I may submit a couple issues/PRs in some time :)