Bugfix for days of month larger than it's max day count and some code reordering