Numerous fixes in ping condition determination algo