Fix test failures for secondary indexing