Multiple fixes

This branch contains fixes for issue #17, issue #19, and issue #20. I also have separate branches for each of these changes if you would prefer separate pull requests.