Noticed wrong variable comparison when looking over code.
Merge pull request #566 from ejc123/FixMean

Noticed wrong variable comparison when looking over code.