Changed multithreading plan to subtrie build-query.
Corrected a bug on mt planning algorithm.