fix really strange errors to do with using ctypes CFUNCTYPE