Merge pull request #1 from xales/master

Various minor fixes