NOJIRA fix error in sorting code that could append duplicate results