fix some bugs related to 2.7 migration