Fixed bin/new_res.php depends on CWD.

Now bin/new_res.php works even if CWD is not the package root directory.