save_primary seems to get called twice. I fixed it locally by adding a dispatch_uid parameter to the connect() call. That prevents it from connecting multiple times. I don't know if that would be a big deal or not.