Merge pull request #197 from ndawe/master

more incremental fixes for #142