Spell checked files.
Removed some dead code and corrected a few code analysis issues.