Fixed issue with beginning of month calculation