Corrected minor index and flags errors