Fix potential problems with X11 code

We assumed that screen is 0; this works some of the time but not all of the time. This should fix cases where it isn't.