scalar product service now terminates correctly again, an if got into the wrong loop.