Fix for MB-12408
Fix crash in a couple places while querying the list of indexes