Bugfix/issue 379 sd grad at 0

Already merged into hotfix/v2.0.2.