Fixed some bugs wrt recursive path lookup