He struggled to contain numerous scandals in the Church during his papacy, not least the worldwide scourge of clerical sex abuse and decades of cover-ups.