Fixed bug in UI rendering which slowed down state rendering.