Fixes bug in ping implementation