Bug in average ms calculation