Merge pull request #75 from rogernorling/master

Various minor code fixes