Fixed migration code