Fixed memory leaks?