fix logging of matrix residual
bugfix in Tuple