Loop fixes

Some small things here, ignore the merge of course…