Added better handling for Count