fixed a few bugs in the norm calculations and tests