Fixed incorrect behavior with badges