Phase shift in atom interferometers: Corrections for nonquadratic potentials and finite-duration laser pulses