Correctly handle multiple children when initializing components