Trying to fix leaky memory.