Made detectAdjust more reliable