Fix stupid interval bug in periodic windows