Fix compilation and test suite