Fix offset handling in lead, lag and nth_value

Maybe explain what was fixed