A couple of memory leaks fixed