fixes to client command parsing and queue locking