You are absolutely right on that. Yes, it was a typo.
I think this is the reason, I introduced the Last Day of Previous month logic to make sure this problem does not happen, but it seems that that is what is throwing it up anyway.
While might be a bit problematic on older dates, although my DB...