Fix some minor bugs, refactored to share docId database