Fixes for migration and deploy