Fix out-of-range note bug. Clean up some array code in TuningView.