Fix low-level count items query