Compilation fixes for everything except TestSanity and TestUcfOpenDj.