Fix more issues with the detection.