fixed printing of valid terms