Bug fix for text nodes