Detach old event listeners.