Cleaned up some of the code and removed unnecessary checks performed in path finding methods.