Duke of Richmond, reported in 1785 that it was "of too bad a form to deserve the expense necessary to repair it" and proposed building a more modern fort along the coast instead. By the end of the century, coastal erosion had destroyed most of the 18th-century grand battery. With the outbreak of the Revolutionary and Napoleonic Wars at the end of the 18th century, Southsea Castle's importance increased once again. In 1797, a French invasion appeared imminent and the castle was urgently readied for action; only eight 32-pounder (14.5 kg) and five 6-pounder (2.7 kg) guns were available and these were in a poor condition. In 1813, work was begun to expand the castle, under the direction of Major-General Benjamin Fisher. Fisher had the work carried out by a mixture of soldiers and civilian contractors, arguing that it made it easier to contain costs and prevent union activity and the project cost an estimated £18,105. The fort was extended north by up to , with the keep and interior bailey redesigned in brick. The moat was rebuilt and a counterscarp galley was built round the edge. Most of the work was finished by 1814 although the final elements were not completed until 1816. A lighthouse, commissioned by the Admiralty, was constructed on the western gun platform in 1828. In 1854 its height was raised and it now stands at above its base atop the walls. The lamp burned sperm oil and was installed behind a fixed dioptric; it showed red and white sectors (red and green from 1854) to guide ships through the safe water between Horse Sand and Spit Sand. The lighthouse keeper was housed in the castle itself. The lighthouse was in continuous use until 2017, when it was superseded by a new structure as part of changes made to approaches to Portsmouth Harbour in preparation for the arrival of the Royal Navy's new Queen Elizabeth-class aircraft carriers. The original dioptric lens, which was subsequently replaced, is now on display inside the castle. An 1837 enquiry had looked into the management of military offenders in the south of England and in 1844 it was decided to bring Southsea Castle and Fort Clarence into use as military prisons, to reduce the pressure on the civilian gaols in the area and to provide a more suitable military environment for the prisoners. Southsea was used as a prison until 1850,