Added some much needed null checks to ComponentGroup.