Fix incorrect error message when using arrays