Merge master and export safe functions from MultiDim.