Replace pypam with ctypes implementation.