problems with Lua nil casting