Minor changes to loops