Fixed old query syntax lookup for teams by prefix
Fixed error when creating teams