Added gradient optimization for bounds on probabilities.
Small bugfix and error message for convenience.