Bugfix for migration script