teams.php bug fixes