Fix bug in rainbow counter