Fixed some errors in averages
Fixed three failing tests
Merge branch 'develop'