Shouldn't this work for an array with a single element?