Added javadoc, fixed some typos.