Fix output paths and copy locals for test libraries.