Fix broken indexing of tag and characters