Many minor fixes to get things building after recent compiler changes