Fix UI glitch.

Also remove debug code.