Made getComponent return a reference rather than pointer