Attempt to fix memory problems.