Fix notify_trait getting called too early.