Added proper handling of output buffers to avoid risky tests during
integration testing.