ERT-673: Fixed bug in matrix_diag_std()