Merge "Updated loop restoration" into nextgenv2