`first` and `last` correctly promote factors, dates and times (#509).