X and misc fixes