Fix empty text node check