Four bug fixes and a feature add

So glad this made it to GitHub! Now I can easily contribute what I've been wanting to. This is just the start :)