Improved stats.mean_var