Fixed OnGlobal bugs