changes to sew() and rip()

Only the beginning chunk lines are modified to "begin.keepcode" and the
end lines remained the same "end.rcode". So made some change to change
the end lines as well.