Better fix for #3125