Fix headless test errors.