Properly expand backup and swap directories.