Build improvements for target detection.