 The Duchy of Lancaster undertook maintenance in the 19th century to ensure the castle's condition did not deteriorate further, mostly by clearing rubble and adding mortar.Sir Walter Scott's 1823 novel "Peveril of the Peak", set in the mid 17th century, described the castle ruins.In 1932 the Duchy gave custody of the castle to the Office of Works, while retaining ownership.