Reworking getTargetMatrix() and getParentMatrix() functions to skip non-symbol elements.