fix for #814 and more discovered during testing
Merge branch 'master' into integration