Clarify OSR in manual

(manually cherry picked from commit 44fe31c73f6e2070b2fc761614d039627afcf82c)
Clarify description of histval for stochastic simulations

(cherry picked from commit acf688c17822877ce2cdad79dc0a3234addc9cb3)
Filter out more pathological cases in osr1.m

(cherry picked from commit a8c04e3ed5f2ca8c394a4a5e78817cb18f154d17)
Fix formatting problems introduced in 44fe31c7.

(manually cherry picked from commit 59696026e948378fa60c6030a1373ea089947efb)
Correct placement of @end example in manual

(cherry picked from commit e6fadde9e23b2612442a1351c7bca1c102eeb654)