Lots of compiling fixes.