Fixed build_detect_platform issues