Minor cleanup on the display mode hack

Further work is required.