Fix int casting of tag