Use the correct criteria to check for successful reconnection (namely >= 0).