Client bug fixes

A few client connection bug fixes