Fix buggy data migration