Fixed lingering nbsp replacement issue