The 5th daimyō, Niwa Ujioto, attempted to revive the domain's financial situation by hiring an outside consultant, Yamamura Seibei.Although the reforms were largely successful, this created an outpouring of resentment and violence from his retainers, to the point where the shogunate was forced to intervene to restore order.Five senior retainers were decapitated for sedition, his wife and 25 others were exiled to remote islands, and Niwa himself was demoted to 10,000 koku and reassigned to Takayanagi Domain in Echigo.While the clan was assigned the office of Osaka-jō dai, they had an additional 10,000 koku from shogunal estates in Settsu, Izumi and Mimasaki Provinces.Presented with this fait accompli, Matsudaira Noritoshi arrived in Kyoto on August 20, 1868, and pledged alliance to Emperor Meiji.