Merge pull request #148 from jwendl/master

Fixing bugs