Fixed incorrect iteration increment that caused problems with multiple RAMs.