Updated to pretend to honour the return value of chdir.