Found an incorrect indexing in a function that is not used at the moment but does have a use, diag_vect()