Fix compiler error in optional component tests