Small memory management fix