Fixed probability to allow for epsilon != 0 and to avoid dividing by zero when h could be zero.