fixes to provide functionality with new scipy (0.12). This change is
backward compatible with older scipy.