Update doc and fix a small bug