Fix an invalid array cast