Fixing memory leaks in progress