Fix query count, imports