Fixed bugs due to migration