Team count bug fixed and test added