Fixed a bug in custom migrations