Clean up leaks
Add timeouts for ping-receive