diff --git a/fastbit/fastbit-ibis1.3.5/src/category.cpp b/fastbit/fastbit-ibis1.3.5/src/category.cpp
index 5bb80de..a309265 100644
--- a/fastbit/fastbit-ibis1.3.5/src/category.cpp
+++ b/fastbit/fastbit-ibis1.3.5/src/category.cpp
@@ -372,113 +372,108 @@ ibis::direkte* ibis::category::fillIndex(const char *dir) const {
     }
 
     ibis::direkte *rlc = 0;
-    if (dic.size() == 1) { // assume every entry has the given value
-	rlc = new ibis::direkte(this, 1, thePart->nRows());
-    }
-    else { // actually read the raw data to build an index
-	const bool iscurrent =
-	    (strcmp(dir, thePart->currentDataDir()) == 0 &&
-	     thePart->getStateNoLocking() != ibis::part::PRETRANSITION_STATE);
-	array_t<uint32_t> ints;
-	std::string raw = (dir ? dir : thePart->currentDataDir());
-	raw += FASTBIT_DIRSEP;
-	raw += m_name; // primary data file name
-	std::string intfile = raw;
-	intfile += ".int";
-	if (dic.size() > 0) // read .int file only if a dictionary is present
-	    ints.read(intfile.c_str());
-	if (ints.size() == 0 ||
-	    (iscurrent && ints.size() < thePart->nRows())) {
-	    int fraw = UnixOpen(raw.c_str(), OPEN_READONLY);
-	    if (fraw < 0) {
-		LOGGER(ibis::gVerbose > 1)
-		    << "Warning -- " << evt << " failed to open data file "
-		    << raw;
-		return 0;
-	    }
-	    IBIS_BLOCK_GUARD(UnixClose, fraw);
+    const bool iscurrent =
+        (strcmp(dir, thePart->currentDataDir()) == 0 &&
+         thePart->getStateNoLocking() != ibis::part::PRETRANSITION_STATE);
+    array_t<uint32_t> ints;
+    std::string raw = (dir ? dir : thePart->currentDataDir());
+    raw += FASTBIT_DIRSEP;
+    raw += m_name; // primary data file name
+    std::string intfile = raw;
+    intfile += ".int";
+    if (dic.size() > 0) // read .int file only if a dictionary is present
+        ints.read(intfile.c_str());
+    if (ints.size() == 0 ||
+        (iscurrent && ints.size() < thePart->nRows())) {
+        int fraw = UnixOpen(raw.c_str(), OPEN_READONLY);
+        if (fraw < 0) {
+            LOGGER(ibis::gVerbose > 1)
+                << "Warning -- " << evt << " failed to open data file "
+                << raw;
+            return 0;
+        }
+        IBIS_BLOCK_GUARD(UnixClose, fraw);
 #if defined(_WIN32) && defined(_MSC_VER)
-	    (void)_setmode(fraw, _O_BINARY);
+        (void)_setmode(fraw, _O_BINARY);
 #endif
 
-	    int ret;
-	    ibis::fileManager::buffer<char> mybuf;
-	    char *buf = mybuf.address();
-	    uint32_t nbuf = mybuf.size();
-	    do {
-		array_t<uint32_t> tmp;
-		ret = string2int(fraw, dic, nbuf, buf, tmp);
-		if (ret > 0) {
-		    if (! ints.empty())
-			ints.insert(ints.end(), tmp.begin(), tmp.end());
-		    else
-			ints.swap(tmp);
-		}
-	    } while (ret > 0 &&
-		     (! iscurrent || ints.size() < thePart->nRows()));
-	}
-	if (iscurrent) {
-	    if (ints.size() > thePart->nRows()) {
-		unsigned cnt = 0;
-		const unsigned nints = ints.size();
-		for (unsigned i = 0; i < nints; ++ i)
-		    cnt += (ints[i] == 0);
-		if (cnt + thePart->nRows() == nints) {
-		    LOGGER(ibis::gVerbose > 1)
-			<< "Warning -- " << evt << " found " << nints
-			<< " strings while expecting " << thePart->nRows()
-			<< "; but the extra " << cnt
-			<< " strings are nulls, will remove the nulls";
-
-		    cnt = 0;
-		    for (unsigned i = 0; i < nints; ++ i) {
-			if (ints[i] != 0) {
-			    ints[cnt] = ints[i];
-			    ++ cnt;
-			}
-		    }
-		}
-		else {
-		    LOGGER(ibis::gVerbose > 1)
-			<< "Warning -- " << evt << " found " << nints
-			<< " strings while expecting " << thePart->nRows()
-			<< ", truncating the list of values";
-		}
-	    }
-	    else if (ints.size() < thePart->nRows()) {
-		LOGGER(ibis::gVerbose > 0)
-		    << "Warning -- " << evt << " found only " << ints.size()
-		    << " string value" << (ints.size() > 1 ? "s" : "")
-		    << ", expected " << thePart->nRows()
-		    << ", assume the remaining entries are nulls";
-		ints.insert(ints.end(), thePart->nRows() - ints.size(), 0);
-	    }
-	    if (ints.size() != thePart->nRows())
-		ints.resize(thePart->nRows());
-
-	    try {
-		// reorder dictionary and ints
-		ibis::array_t<uint32_t> o2n;
-		dic.sort(o2n);
-		if (! o2n.isSorted()) {
-		    const uint32_t nints = ints.size();
-		    for (uint32_t j = 0; j < nints; ++ j)
-			ints[j] = o2n[ints[j]];
-		}
-	    }
-	    catch (...) {
-		LOGGER(ibis::gVerbose > 5)
-		    << evt << " did not find enough space to reorder the "
-		    "dictionary entries, continue with the existing order";
-	    }
-	    ints.write(intfile.c_str());
-	}
-	if (rlc != 0) {
-	    (void) rlc->append(ints);
-	}
-	else {
-	    rlc = new ibis::direkte(this, 1+dic.size(), ints);
-	}
+        int ret;
+        ibis::fileManager::buffer<char> mybuf;
+        char *buf = mybuf.address();
+        uint32_t nbuf = mybuf.size();
+        do {
+            array_t<uint32_t> tmp;
+            ret = string2int(fraw, dic, nbuf, buf, tmp);
+            if (ret > 0) {
+                if (! ints.empty())
+                    ints.insert(ints.end(), tmp.begin(), tmp.end());
+                else
+                    ints.swap(tmp);
+            }
+        } while (ret > 0 &&
+                 (! iscurrent || ints.size() < thePart->nRows()));
+    }
+    if (iscurrent) {
+        if (ints.size() > thePart->nRows()) {
+            unsigned cnt = 0;
+            const unsigned nints = ints.size();
+            for (unsigned i = 0; i < nints; ++ i)
+                cnt += (ints[i] == 0);
+            if (cnt + thePart->nRows() == nints) {
+                LOGGER(ibis::gVerbose > 1)
+                    << "Warning -- " << evt << " found " << nints
+                    << " strings while expecting " << thePart->nRows()
+                    << "; but the extra " << cnt
+                    << " strings are nulls, will remove the nulls";
+
+                cnt = 0;
+                for (unsigned i = 0; i < nints; ++ i) {
+                    if (ints[i] != 0) {
+                        ints[cnt] = ints[i];
+                        ++ cnt;
+                    }
+                }
+            }
+            else {
+                LOGGER(ibis::gVerbose > 1)
+                    << "Warning -- " << evt << " found " << nints
+                    << " strings while expecting " << thePart->nRows()
+                    << ", truncating the list of values";
+            }
+        }
+        else if (ints.size() < thePart->nRows()) {
+            LOGGER(ibis::gVerbose > 0)
+                << "Warning -- " << evt << " found only " << ints.size()
+                << " string value" << (ints.size() > 1 ? "s" : "")
+                << ", expected " << thePart->nRows()
+                << ", assume the remaining entries are nulls";
+            ints.insert(ints.end(), thePart->nRows() - ints.size(), 0);
+        }
+        if (ints.size() != thePart->nRows())
+            ints.resize(thePart->nRows());
+
+        try {
+            // reorder dictionary and ints
+            ibis::array_t<uint32_t> o2n;
+            dic.sort(o2n);
+            if (! o2n.isSorted()) {
+                const uint32_t nints = ints.size();
+                for (uint32_t j = 0; j < nints; ++ j)
+                    ints[j] = o2n[ints[j]];
+            }
+        }
+        catch (...) {
+            LOGGER(ibis::gVerbose > 5)
+                << evt << " did not find enough space to reorder the "
+                "dictionary entries, continue with the existing order";
+        }
+        ints.write(intfile.c_str());
+    }
+    if (rlc != 0) {
+        (void) rlc->append(ints);
+    }
+    else {
+        rlc = new ibis::direkte(this, 1+dic.size(), ints);
     }
 
     if (rlc) {
