Fixed null reference to util.distwindow, etc.