Fixed global vars and missing messages in asserts().

Both issues causing crashes when run with Lua.