moved away from procedural checks to simplify some checks.
Striping thread support from darwin.
Added extra x11 error code.