Fix ResourceWarning.