Fix issue #216 and #219 by moving current server check to the connect method.