More fixes for headless unit tests