Remove unused code and fix ping.