Fixed the copy method so that the file name and its parent directory are actually separated by a '/'.