Fix javaoc, correct spelling, simplify implementation of hasChildren() method, add test for it.