Boolean terms conversion fix for datatypes, fixes a problem Andy discovered on his branch.