Some javadoc and optimization fixes.