Merge "Do not modify vector after getting references" into sc-dev