In 1806, with the Netherlands under Imperial French domination, Emperor Napoleon I appointed his brother Louis Bonaparte to the Dutch throne, which led to the 1808 appointment of Marshal Herman Willem Daendels as governor-general of the Dutch East Indies. In 1811 Daendels was replaced by Governor-General Jan Willem Janssens, but shortly after his arrival British forces occupied several Dutch East Indies ports including the Spice islands in 1810 and Java the following year - Thomas Stamford Raffles became lieutenant governor. Following Napoleon's defeat at the 1815 Battle of Waterloo and the Congress of Vienna, independent Dutch control was restored in 1816. Under the 1824 Anglo-Dutch Treaty, the Dutch secured British settlements such as Bengkulu in Sumatra, in exchange for ceding control of their possessions in the Malay Peninsula (Malaya) and Dutch India. The resulting borders between former British and Dutch possessions remain today between modern Malaysia and Indonesia.