Including comments from pull request.

Fixing formatting, correcting javadoc.