Some fixes and enhancements
Merge pull request #23 from mdahm/master

merge