Fixed badge generation. Added an example of use in the 'Widget' page.