Fix migration bug