Fix compilation errors caused by #866