Correctly update modules before copying over external dependencies