Fix error in function to move files to the 'work' directory.