In this paper we describe the wavefront aberrations that arise when imaging biological specimens using an optical sectioning microscope and generate simulated wavefronts for a planar refractive index mismatch. We then investigate the capability of two deformable mirrors for correcting spherical aberration at different focusing depths for three different microscope objective lenses. Along with measurement and analysis of the mirror influence functions we determine the optimum mirror pupil size and number of spatial modes included in the wavefront expansion and we present measurements of actuator linearity and hysteresis. We find that both mirrors are capable of correcting the wavefront aberration to improve imaging and greatly extend the depth at which diffraction limited imaging is possible.