fix vectorize() and mean()