add protection against nan in divergence
Merge branch 'master' of github.com:marcelrf/shepherd