Fixed migration related issues