Better fix for #4284