fixing bugs with sage pointer manipulation of windows