Finding the fundamental frequency from Autocorrelated data
Three suggestions:


Try searching only over your expected pitch range: from a lag or period a bit shorter than that of your highest expected pitch for the instrument in question, to a lag a bit longer than twice the period of the lowest pitch expected.
Make sure there is a sufficient dip between your highest and your 2nd highest peak, or else you might find the shoulder of the 1st peak, and thus completely miss finding any 2nd peak.
You might also want to try using parabolic interpolation to better estimate each pitch period if any are between autocorrelation lags.