fixed indexing and typo; Closes PR 14575, Closes PR 14564