Added scalar product and test.
Fixed scalarprod
Fixed test of scalar product.