Merge pull request #29 from thomie/bugFixes