restore code fixes