Hendrik Leppkes:
	Fix a leaked global and add some sanity checks in the display functions.
