 He was subsequently appointed Commander of the Forces in British-occupied Java and in 1812 he deposed the Sultan of Palembang in Sumatra, and took the royal Javanese city of Yogyakarta.On his return to India he speared a tiger that escaped from a cage and prowled on Bangalore racecourse.Two years later, at the beginning of the Anglo-Nepalese War, he led a column to attack a Nepalese hill fort at Khalanga, in the Battle of Nalapani, repulsing a Gurkha counter-attack.