Merge pull request #924 from oliverds/master

Several bug fixes and enhancements