Fix moving files from tmp dir to final location

I assume this is all tested? I can't really tell what the effect of joining in the DObject twice is, but I assume it is benign?