Fix piecewise surface problem turned up by llvm.