Fixed mass replace bug