Fix issue when modifying text inside an element

Found an edge case this morning. Yay non-element node types