Changed UIElement construction slightly