Fixed migration script (part 1)