Fix incorrect window size calculation for candidate window.