Fixed zero counting and centroid frequency estimates. Fix to stdev calculation as well.