Fix: Reorder temp directory creating code.