Better fix for #4294