Effects of bottom topography and density stratification on the formation of western boundary currents