Maintaining locks