Fix bugs in algorithm of building of Decision tree