Add test case for PathResolver and fix some bugs in the logic