Memory management fix.