Fix compilation
LOTS of mostly minor changes