Fix some failing tests and attempt to fix running tests on a headless computer