  We consider the influence of transverse confinement on the instability
properties of velocity and density distributions reminiscent of those
pertaining to exchange flows in stratified inclined ducts, such as the recent
experiment of Lefauve et al. (J. Fluid Mech. 848, 508-544, 2018). Using a
normal mode streamwise and temporal expansion for flows in ducts with various
aspect ratios $B$ and non-trivial transverse velocity profiles, we calculate
two-dimensional (2D) dispersion relations with associated eigenfunctions
varying in the 'crosswise' direction, in which the density varies, and the
spanwise direction, both normal to the duct walls and to the flow direction. We
also compare these 2D dispersion relations to the so-called one-dimensional
(1D) dispersion relation obtained for spanwise invariant perturbations, for
different aspect ratios $B$ and bulk Richardson numbers $Ri_b$. In this limited
parameter space, the presence of lateral walls has a stabilizing effect.
Furthermore, accounting for spanwise-varying perturbations results in a
plethora of unstable modes, the number of which increases as the aspect ratio
is increased. These modes present an odd-even regularity in their spatial
structures, which is rationalized by comparison to the so-called
one-dimensional oblique (1D-O) dispersion relation obtained for oblique waves.
Finally, we show that in most cases, the most unstable 2D mode is the one that
oscillates the least in the spanwise direction, as a consequence of viscous
damping. However, in a limited region of the parameter space and in the absence
of stratification, we show that a secondary mode with a more complex `twisted'
structure dominated by crosswise vorticity becomes more unstable than the least
oscillating Kelvin-Helmholtz mode associated with spanwise vorticity.
