More robust freeing of resources.