Fix StopIteration when there are no tables in metadata.