Better fix for #2659.