Fix compilation errors, test validate