Improve the robustness of pointwise kernel generation.