Misc. bug fixes.
Merge pull request #7 from hey-you-project/Miscbugs1

Misc. bug fixes.