add test case for having no indexes, and fix regression in that case