Removed duplicated count of number of valid samples