fix calculation of norms