diff --git a/src/user/user_model.cc b/src/user/user_model.cc
index e0dc7e77..51eb89c0 100644
--- a/src/user/user_model.cc
+++ b/src/user/user_model.cc
@@ -386,6 +386,8 @@ mjCModel& mjCModel::operator+=(const mjCModel& other) {
for (const auto& key : other.key_pending_) {
key_pending_.push_back(key);
}
+ CopyList(numerics_, other.numerics_);
+ CopyList(texts_, other.texts_);
}
CopyList(flexes_, other.flexes_);
CopyList(pairs_, other.pairs_);
@@ -394,8 +396,6 @@ mjCModel& mjCModel::operator+=(const mjCModel& other) {
CopyList(equalities_, other.equalities_);
CopyList(actuators_, other.actuators_);
CopyList(sensors_, other.sensors_);
- CopyList(numerics_, other.numerics_);
- CopyList(texts_, other.texts_);
CopyList(tuples_, other.tuples_);
// create new plugins and map them
diff --git a/test/user/user_api_test.cc b/test/user/user_api_test.cc
index 22bb76e6..6e33580f 100644
--- a/test/user/user_api_test.cc
+++ b/test/user/user_api_test.cc
@@ -631,6 +631,10 @@ static constexpr char xml_child[] = R"(
+
+
+
+
@@ -694,6 +698,10 @@ TEST_F(MujocoTest, AttachSame) {
+
+
+
+
@@ -833,6 +841,10 @@ TEST_F(MujocoTest, AttachDifferent) {
+
+
+
+
@@ -957,6 +969,10 @@ TEST_F(MujocoTest, AttachFrame) {
+
+
+
+
@@ -1063,6 +1079,10 @@ void TestDetachBody(bool compile) {
+
+
+
+