lock bug fixes