Readded calculation of descent, to fix issue #337.

Fixes issue #337