Fixed path finding bug