Add missing javadoc and fix code style.