More complete fix for #2895