Fixed bugs in data migrate