revert removing $PWD and make minor fix