fixed design flaws in LuaState