Fixed bug in Entity::addComponent