little logging fixes.
fixed dual declarations.
added ping functionality and minor improvements to client establishment.