compat: move PWD definition early