typesafe_cb: more support for typesafe compare functions.