Fix bug where copy recursive was not finishing correctly.