#20: Fixed most of the bugs in _collect_paths().