Add client ping, tidy logging