fix for invalid root on ping (Issue #32 and #29)

Fixes #32
Fixes #29