Fixes error in handling of end of year on Python 2.7.5