Merge "Revert "Fix crash due to inconsistent handling of CR"" into main