Fixing _run_as_pg so it does not conflict with a nested cd