Fix ldetect