Move to XCB; Fix a mem/resource leak