Revert "loop fixes"

This reverts commit a73044f79c119c25f92855c40142f79ee0889aca.