Fixed a bug with pre elements in searchreplace/spellchecker logic.