fixed seg fault with NULL values, but id_compare is returning the reverse of what it should)