Made sure empty dirs are also preserved.