Qianshan became the seat of the subprefect or "keun-min-foo" ( "jūnmínfǔ") in 1731. He was charged with dealing with the foreign settlement and overseeing their trade with Guangzhou ("Canton"). As part of these duties, he controlled the permits needed for pilots "yǐnshuǐrén") of the ships sailing north through the Humen ("Bocca Tigris" or "Bogue") to the Huangpu Anchorage ("Whampoa", now Pazhou). He would ensure that foreign ships headed upriver had some cargo apart from silver dollars and bullion. He was also sometimes obliged to quarantine Macao's market, prohibiting Chinese farmers and merchants from trading there and supplying its food, in order to maintain the freedom of the area's Chinese to practice Buddhist and local rituals, which the Portuguese periodically attempted to prohibit. In the lead-up to the First Opium War, Lin Zexu and Deng Tingzhen visited Qianshan during their procession from Xiangshan (now Zhongshan) to visit the Portuguese authorities at Macao on 3 September 1839.