Fix tests compilation

Hi,

I am not sure those changes are the right ones, some logic might be lost, but at least the compilation is running fine now.