Fix error when returning multiple paths, add unit test coverage