Fixed issue with null count returned