fixed scalar product and norm2() overflowing for vec