Fix K3D patching and cmake-configuration phases