bugfixes from merge
Merge pull request #37 from rgoldfinger/master

bugfixes from merge