Fixing memory leaks, some more remain.