Fixed flattening of hidden subtagsin optimize flag