Fixes a memory leak.