Added anti-ping, general cleanup