Updates:

- code cleanup,
- javadoc comments updated,
- unit tests fixed.