Fix memory leaks.
Drop extra memory in some more areas.