Fix dedup and dupnum conflicts in client.
Update C Client to thread safe and auto connect.