Fix for regression in #331, and #344
Fix for regression in #331 and bug #344
Merge pull request #351 from paulej72/master

Fix for regression in #331, and #347