Destructors implemented. Memory leaks fixed.