Fix comparison of n_results. Integer promotion broke the < 0 case.
Move define of mask for trust objects handle to header.
Switch implementation of tracking objects found from list to hash table.
Remove unused functions.