Fix loops and Bad Detour Argument