Fix variable references in window predications