Bug 958116 - fixes for create/update middleware and migration script fixes