Clean up printing of error messages from tests