A lot of changes.
Loop fixes.