Fix 'could not get cwd' errors