Finalized javadoc and unit tests.

Few adjustments.