Use base-dir instead of chdir