fixing compilation errors, with @chaubold