Avoid an infinite loop with trace exceptions