A bunch of fixes and modifications added

Yay! I'm done. This pull request is an extended version of #23. Check out the commit messages that cover all the fixes and adjustments. Feel free to merge if you agree! Thanks