CLDIDE-2163: add small fixes of code, tests and javadocs; add comments