Merge "Cast to int for union tag" into tm-dev