Allow use of parent setting, and fix the directory deduping.