Update shared.lua

Some fixes
Merge pull request #2 from RealBadAngel/patch-1

Update shared.lua