Small code changes and more JavaDocs.