Minor cleanup.  Add error checking for sum prob != 1.