Made retry for unlock optional, cleanup formatting