Fixed team checking, Added path checking