lua 5.2: change table.getn to #