Bug in the computation of scalar matrix - fixed