Added fix for negative collection count issue