Correct implementation of `@first` / `@last`

Previous implementation incorrectly made @first and @last the value of
the first and last items in the sequence, respectively. Correct
behavior is boolean to indicate whether the current iteration is the
first or last, respectively.