Fix for average