port minor patches to the backend into part-1 patch
fix tabbing