Fixed some thread locking issues