Fix guard macro.
Fix computing average values.