Add better parser-side support for tag reading, fix a minor bug