Track errors in build script fragments
Optimized detectTarget() for ipl scripts