Added some restore code.