Changed how pwd is set.