Changes to createPath and createLayerPoints to prevent using too much memory during very large inserts.