fixes based on discussions with rory
Merge pull request #921 from Pomax/bug900

fixes based on discussions with rory