Fix loops