changes to be robust to emcee versions