Fix replication attachment issues