fixes to headless server mode