Clean up internal event handlers.