Fix a bug in sprite replication