Fix a couple bugs in the moving-files-when-done code