Fix headless support.

Should fix headless support.