fix minor bug - count must be additionally computed if a where option is used.