Merged fix from dump-restore-on-directory