Revenues from the patrimonies were used for administration, to maintain and build churches, to equip convents, run the papal household and support the clergy, but also to a great extent to relieve public and private want. In administering the Patrimony of St. Peter, Pope Gregory (540-604) showed a considerable grasp of detail and administrative capacity. In anticipation of a threatened corn shortage, Gregory filled the granaries of Rome with the harvests of Egypt and Sicily. Numerous poorhouses, hospitals, orphanages and hospices for pilgrims were maintained out of the revenues of the patrimonies. Gregory also spent large sums ransoming captives from the Lombards, and commended one of the bishops for breaking up and selling church plate for that purpose.