Merging in changes to get badge template to work into mainline.