>Assuming table is at index 1
Index 1?
In general, the index of the stack is a negative number, e.g -1, -2, and so on.
Not in the common case of referring to arguments passed to your C function from Lua, which are usually referred to with positive numbers (since the first argument is always at index 1, the second argument at index 2, etc.)