Merge pull request #40 from Magenic/master

Merge pull request #148 from jwendl/master
Fixing issue #144
Fixing issue #145
Fixing issue #146
Merge pull request #149 from jwendl/master

Fixing issues.