Fixed more locking issues