Fixed bug in unlock.