Typo
Merge pull request #362 from ameenross/patch-1

Typo
CS fixes and a bit of refactoring to improve readability