The bulk of the changes in Spanish America came in the second half of the 18th century following the "visita general" (general inspection) of New Spain (1765–1771) by José de Gálvez, who was later named Minister of the Indies. Upon his inspection, he found the viceroyalty in shambles and then reorganized the tax collection system, rewarded loyal Spanish merchants, jailed corrupt tax collectors, and steered the local economy towards mining. The reforms attempted in New Spain were implemented elsewhere in Spanish America subsequently. There had been one earlier reform in the creation of the new Viceroyalty of New Granada (1717), carved out from the Viceroyalty of Peru to improve the administration of the overseas possessions. The new viceroyalty was created initially in 1717, suppressed just six years later, and then permanently established in 1739, still earlier than the reforms of the late 18th century. It was an administrative change that reflected the recognition (as early as the 16th century) that the northern area of South America had certain challenges of distance from Peru. There had been earlier creations of captaincies general in Guatemala and Venezuela, marking an increase in their importance. The addition of the viceroyalties in order to compensate for challenges of distance between northern South America and Peru also came about as a result of the need to protect the vital trade routes that existed between these regions. In 1776, a second jurisdiction, the Viceroyalty of Rio de la Plata was also carved out of the Viceroyalty of Peru in 1776 as part of José de Gálvez's comprehensive administrative reform. In the same year, an autonomous captaincy general was also established in Venezuela. Even after his time in the colonies, José de Gálvez joined the Council of the Indies and eventually rose to the top of that, effectively becoming the most influential figure in the legislation of colonial Americas.