Incorrect error message if using last()

If you write a query like the following 

     select last() from foo

You get a seemingly unrelated error message referring to max()

![screenshot 2014-11-04 11 11 45](https://cloud.githubusercontent.com/assets/242382/4905258/4366f6e4-644e-11e4-8d8b-dced2e038706.png)