Removed trailing whitespaces and fixed typo.

I'm not sure it's worth for you guys to merge this pull request. I removed quite a lot of trailing whitespaces, and I'm not sure whether this will cause a lot of conflicts later when trying to merge other stuff.

I will totally understand if you are okay droping this pull request. Let me know if I have overlooked something important.