Improved the makedb script.  It now adds the lock field immediately ly instead of waiting for the counts function to finish