Check whether a month is followed by a year

Bug fix for #375