Fixed the bug from the method findAllPaths of TraversePaths