Bug fixes for window frames, add window frame clause support to avg