A lot of compilation fixes...

Oups I did it again...
Please think about unit testing later PLEASE.