Fix windowing error

Use :next for lower bound, :previous for upper bound in within