Fixed bug in afg migration