Fixed error with indexing empty terms.