Fixed connection count bug