Cleaning up unused dependencies and removing automatic local copies