Fix headless tests