small fixes to migration script.