Potential fix for #1004
Merge branch 'master' into diagnose-fix
Merge branch 'diagnose-fix'