Add doc and fix a bug.