Minor raw backend fixes.
TODO: test the SRM changes and maybe cherry-pick other fixes from experimental branches.