Standardise onClose.