handle null ctypes ptr correctly
make def test pass by returning correct type