Added fix for tags count mismatch issue