Added javadoc and some exceptions to hist(...)