Merge pull request #40 from gahr/master

Various fixes