Fix some lua-tests bugs