Fixed issues with unlock script