Cleaned code and fixed warnings
Fixed ping memory leaks