Fix some display bugs.

Fix a few bugs about display logic.