Remember, the Holy Spirit ensures that the Church's teachings on morality are correct, even when made by lying dirtbags like O'Malley, Francis, Mueller, JPII  etc.  It's all very magical.  Morally bankrupt scum who do not care if children are harmed, when gathered together, by supernatural intervention, speak infallibly.  Quite amazing really...