Fixes #291: Ensure the parent directory exists before renaming to ensure standard behaviour [Local]