Added support for first() and last()