Fix migrate package bug found in #1201