fixed: query error in CAST function (ordered groups tab)