Yet another fix for headless mode.