Fix more random errors.

Like an infinite loop
and a missing loop...

Mosly just loopy stuff.