Update global.lua and small fix and optimization on Ruprecht