Query generator: insert casts to linkedHashSet and to list where necessary
Fixed typo imorted languages