Add some safety checks to print out some trace info