Fix couple of bugs when storing and copying files.