Corrected bug in mortality distribution

And added a test case