Fixed cleaning up in the "build" generators with an empty target path.