Fixed connect bugs.