Added some more namespace awareness and a tag text checking step