update some code
fix compilation and tests