Fix doLast for copyMainDeps