Fixed next() for mixed tables