(#7) Memory leaks fixed