Fixed more bugs on client connect