Fixed min/max calculation array access