Merge pull request #25 from Cueie/master

bugfixes by cueie
fixes
fix #26 (not tested)
Merge remote-tracking branch 'upstream/master'