Fix to averagingIn