Final cleanups.

To be honest, I think this is bug free. This is ready to get merged into master branch.
Merge pull request #807 from Need4Speed402/patch-3

Final cleanups.