Fix a few undefined bugs in the display mechanism

Reported by Illori. Wasn't able to reproduce them myself but figured I'd fix up this code either way.

Signed-off-by: Yoshi2889 <rick.2889@gmail.com>