Fixed memory leak and new doc.