 Complete the following phrase:  The last count of Nidau, Rudolf IV died in 1375 in a battle in the Gugler War. The next owner of the castle was the Prince-Bishop of Basel, Johann von Venningen. However, he was defeated in 1376 and the Counts of Kyburg acquired the castle. In 1379, Count Rudolf von Kyburg sold the castle and town to the Habsburgs. The Habsburgs then gave the castle as a fief to Enguerrand de Coucy, the former commander of the Guglers, in 1387. During the 