Fix lead, lag and nth_value