You're taking 100 readings. Those 100 readings are stored in total, which is an int. An int can only store up to +32,767. That means that if your values average above 327, you're going to have issues.
Either store less readings, or use a long as your total instead of an int.