Flush stdout logs.
Making exceptions stay around when assertions are
switched off.
Adding a simple check for exceptions.