Fixes to end_of_life condition