Fixes in patches for migration