Fixed a bug with the average function in basic_math.py.