Fixed error in count function.