Port latest changes from CMG v5 in 5_3_14 to v6