Fix a bug in the display code