Merge "Fix some NPEs in shell transitions" into sc-v2-dev