Fix analytics query lowercase bug