Possible memory leaks fix.