Fix incorrect usage of inArray