Minor fixes for connecting