Compare  instead of ['year'] to ['year_end'] to fix #1865