Fix bug in migrations