change name of "dir" var
Add ref paths, do not require etc files
Copy dir ownership properly, correct the fix up script