Fix ThrowNativeError and remove duplicate operation in zr_modulemanager