Remove redundant variable in populate_weights.