Fix risky tests

Fix the various tests that were failing as 'risky' in the past. Most are related to PHPUnit being very picky about output buffering levels these days.