Fix window switching and paste