Fix for GH#8944. x.size=='L' returns scalar. Needs to be x['size']=='L' to give a boolean array.