Added support for scalar types in function COUNT