Update shared.lua

Some fixes