Added robustness to loops (III).