Re-detect null value and fix some ctypes conversion