fix more warnings, implement missing X11 function for dynamic loading