refine code for bug #194, add comments to macros.