Some cleanup and fixes for UI code.
Also disables automatic overstrike mode in UI fields.