Better support for headless mode