Improve badge display behavior. Closes #55 and #56.