Effects of ionic size on the x=18 anomaly in La2−xBax−yMyCuO4 (M=Ca,Sr)