Fix off-by-1 error in the tag parsing code.