Fixed a couple of bugs.
Added ping support.