fix various issues with cascading replication including move set

note: the system appears to have a resource leak