More KNF.
More KNF and clean up.
Pull out the sequence number selection and handle this up front. Also, the
correct record is already known, so avoid reassignment.