Fixed a bug in migrating data from v1 to v2