Fixing handling of pathalogical cases where inverse function for dose becomes discontinuous.