Fixed connection bugs