The divisor for the average calculation should be based on the value array.
Merge pull request #278 from jkew/master

The divisor for the average calculation should be based on the value array