Try to fix memory leaks