A bunch of fixes ;)
Merge pull request #6 from Glassmaker/master

A bunch of fixes ;)