Fixed client locking bug, fixed server locking bug