Fixed bug with incorrect children counting.