Naive fix for infinite loops in pretty printer