Correct compilation issue and X crash
fix compilation issue