fix out-by-one bug and num_days <1
fix out-by-one bug and num_days <1

aidendoherty/biobankAccelerometerAnalysis,aidendoherty/biobankAccelerometerAnalysis,computationalEpidemiology/biobankAccelerometerAnalysis,computationalEpidemiology/biobankAccelerometerAnalysis