branches: 1.5.4; 1.5.10; 1.5.18; 1.5.22;fix some define and cleanliness issues relevant when test compilingin dist (which we normally don't do)