Add @index, @first, @last support