Fix a bug found by g++ 4.3, and add a few comments.