Bugfixes

Closed #24 #41 #37

I apologize for doing multiple things at once. Probably should be a pull request for each bug or tweak made.
Might be easiest to look at/comment on commits instead of file change. Let me know what you think.

I also noticed a bug and made a new issue #42