[BUGFIX] Some unit tests fail with "Cannot modify header information"