Fixed a couple of issues, new version.

fixes #1 and fixes #2 and fixes #3