Various connection fixes