Fix bug that got nullpointer exception when reading an empty tag