consul: Fixing key list index calculation