Since the counts of Gruyères also possessed sovereign rights in Bulle, there were numerous conflicts between the counts and the bishop in the 12th, 13th and 14th centuries. Since these conflicts were always decided in favor of the bishop, the counts eventually lost all rights in Bulle. Even by the 12th century, Bulle was an important regional economic center. In 1195/96, Count Rudolph closed the market in Gruyère and extended his support to the older market in Bulle. At that time, the town was a collection of homesteads, which surrounded a church and maybe had a castle near them. In the 13th Century the bishops recognized that the town was crucial to their income and to administer and defend the surrounding region. Bishop Boniface erected a city wall surrounding a rectangular town with two lanes and four rows of houses in 1231–39. A little later, possibly under the episcopate of William de Champvent (1273–1301), the castle was built was in the southeast of the city. The main building of the castle was a tower that dominated the south gate and the surrounding plain. Throughout the Middle Ages, the bishops appointed two officers, the castellan and the mayor to rule the town. Throughout the 13th to 15th centuries, the noble de Bulle family held the office of mayor. Although citizens of Bulle are mentioned in 1195/96, they first had an organization in the 14th century testifies. Starting at end of the 12th century, individual freedoms, rights and privileges were often conferred on the citizens of the town and in general the citizens of Bulle had the same privileges as citizens in Lausanne. Starting around 1350, many of the towns in the Saanen valley between Gruyere and Arconciel lost most of their historic importance and population. However, due to Bulle's favorable location, its infrastructure and the support of the bishops, it remained an important regional center. It was also able to recover quickly from a devastating fire in 1447.