MADS: Fix incorrect array indexes referencing outputIndexes