Attempting to fix memory leak.