Bug fix in Text#lock/unlock methods