Better Lua error checking