Fix loops and exitASAP