copy the input in the length < 2 case also

and throw an Error if input is not an array.