bugfixes to interpolate_cm.py