Add option to suppress old xsession errors and some code unification