I would recommend also taken this problem into consideration when rewriting the algorithm: HSEARCH-1112