More compilation fixes

This is not going to be easy.