Added some better boundary checking for standard distributions.