Fix wrong compared values

They should be keys not records themselves.