Fix incorrect logic for calculating daily stats