Improve handling of years with limitations on representable dates