In situ wavefront correction and its application to micromanipulation