corrected a bug in the termExpansion method
improving on classes in the Query hierarchy