Fixed bugs and unused imports found and various issues.
Merge pull request #92 from matthewrice345/master

Fixed bugs and unused imports found and various issues.