Made the getAttribute check more explicit - comment nodes don't have getAttribute...