Some fixes to the reference and interface generator as simplification of chdir() calls.