fixes #240, #274, #108
Merge pull request #305 from jsmartin/devel

fixes #240, #274, #108