Catching HeadlessException when on systems without display.