Fix ctypes: compare values instead of pointers.