Mahalanobis distance seems to be giving me trouble, so I replaced it with Euclidean distance and rescaled the regional maxima coordinates.