Fixed bug in calculating life expectancy