Fix crash for bag migration

This appears to be a copy and paste error. You should check the
rename rule order and not the last element of the list.