Fixing some issues after Jai's merge