Fixes migration bug