[Rewrite] Cast int32 overloads to native int

Int32 parameters should be converted to native int when the native signature expects the latter.