fixed bug at end of experiment

When last row of procedure was reached, the trial type was searched for, even though it was the EndOfExperiment line.  This was creating a small warning, which was preventing the redirect if buffering wasn't enabled.  So, I moved the opening of the buffer before that point.