CXX-295 include all query modifiers in count command
CXX-341 remove unneeded null check