Fixes for pathological loops