Fixed memory leaks. Added Tools.