Merge #10521: Limit variable scope