Repositioned ping and timeout functions.