Handle NULL result in avg_ too.