Fix flicker bug introduced in merge