Integer overflow fix

I use large values in getInUserPeriodAsInt() (several days) and the inUserPeriod integer overflows.