Reworked some of the code so asserts are no longer necessary. Added additional and potentially redundant checks Added checks where the null checker found real problems. PR Close #16422