Minor bugfixes for recent average