FIX: Better windowing

@rkmaddox ready for review/merge, fixes a small bug with windowing (round-off error in old code).