Properly guard for text nodes nodes